home *** CD-ROM | disk | FTP | other *** search
/ HyperLib 1997 Winter - Disc 1 / HYPERLIB-1997-Winter-CD1.ISO.7z / HYPERLIB-1997-Winter-CD1.ISO / オンラインウェア / PRG / Mac_F2C_1.3.2.sit / Mac F2C 1.3.2 / Mac F2C Extras / Mac F2C and Alpha / f2c.tcl next >
Text File  |  1996-03-06  |  19KB  |  627 lines

  1. #=======================================================================
  2. # F2C.TCL supports MAC F2C and CODE WARRIOR
  3. #=======================================================================
  4. # 1.0b1    jul 95
  5. # 1.0b2    jul 95    listpick with -L blah as default, in the hope that blah
  6. #                is no listelement. -L {} selects always the first
  7. #                listelement.
  8. # 1.0b3    Dec 95    changes for CW IDE, some more comments
  9. # 1.0b4    Mar 96    added timeout option to AEBuild commands with replies
  10. #
  11. # Questions, comments, and bug reports to:
  12. #            Klaus Thermann
  13. #            klaus@gaga.maschinenbau.uni-dortmund.de
  14. # Thanks to 
  15. #            Dirk Froehling for lots of help with the Mac OS,
  16. #            Igor Mikolic-Torreira for making MAC F2C available.
  17. #
  18. # Usage
  19. #    ・ To see how it works
  20. #        Bring this file to the front, load it by cmd L, and play around
  21. #    ・ For permanent usage
  22. #        Put it into the "Tcl:UserCode" folder of Alpha
  23. #        Edit Prefs.tcl and add the line
  24. #        source "$HOME:Tcl:UserCode:f2c.tcl"
  25.  
  26. #        
  27. # Menu procedures
  28. #
  29. # Translate F To C
  30. #                Translates frontmost window from f to c using current
  31. #                settings of MAC F2C, does nothing if frontmost window
  32. #                is not *.f. If the window is dirty, it is saved before
  33. #                translation.
  34. #
  35. # Open Project    Closes current project, offers file dialog to select a
  36. #                project and tells codewarrior to open it. The name of
  37. #                the selected project appears as (always) deactived menu
  38. #                item. Builds the list and menu items projectFiles and
  39. #                otherFiles (see below)
  40. #
  41. # Get Project    Assumes that a code warrior project is open and gets
  42. #                its name and files. If no project exists: file dialog
  43. #                as above
  44. #
  45. # Switch To Project
  46. #                Select project from list. The list f2cProjects is saved
  47. #                between sessions (addDef) and extended when a project is
  48. #                opened not contained in the list.
  49. #                Remove From List ... offers a dialog to remove files 
  50. #                from f2cProjects.
  51. #
  52. # Project Files    Is a list of *.f files in the project folder which
  53. #                have corresponding *.c files in the codewarrior project.
  54. #                These files are edited (or simply brought to the front)
  55. #                when selected.
  56. #
  57. # Other Files    Is a (possibly empty) list of *.f files in the project
  58. #                folder having no *.c counterparts in the project.
  59. #                Editing as above.
  60. #
  61. # Run            Saves all modified files and translates from f to c, 
  62. #                followed by CODE WARRIOR run. 
  63. #                When f2c detects an error the process is stopped and the
  64. #                *.f file, where the error was detected, brought to front.
  65. #
  66. # Make            Saves all modified files and translates from f to c, 
  67. #                followed by CODE WARRIOR make. 
  68. #                When f2c detects an error the process is stopped and the
  69. #                *.f file, where the error was detected, brought to front.
  70. #
  71. # Add File        The *.c file corresponding to the frontmost *.f file is 
  72. #                added to the project (if the *.c and *.f are in the
  73. #                project folder, returns otherwise)
  74. #
  75. # Remove File    The *.c file corresponding to the frontmost *.f file is 
  76. #                removed from the project (if the *.c and *.f are in the
  77. #                project folder, returns otherwise).
  78. #
  79. # F to C & Add Files...
  80. #                Offers a dialog to pick files from list otherFiles. 
  81. #                The selected files are translated from f to c and added 
  82. #                to the cw project.
  83. #                When f2c detects an error the process is stopped and the
  84. #                *.f file, where the error was detected, brought to front.
  85. #
  86. # Remove Files...
  87. #                Offers a dialog to pick files from list projectFiles.
  88. #                The selected files are removed from the cw project.
  89. #
  90.                 
  91. # We want CodeWarrior's IDE, but alphabits.tcl sets the
  92. # 68k C version (set cwSig MMCC).
  93. set cwSig CWIE
  94.  
  95. # Define CodeWarrior event class (same as in codewarrior.tcl)
  96. set CWCLASS MMPR
  97.  
  98. # Use "F2C" as menu title
  99. set f2cMenu F2C
  100. # To use the Mac F2C icon as title for the F2C menu, copy it
  101. # from Mac F2C to Alpha with ResEdit, replace "134" in the next
  102. # line with the icon ID and uncomment the line
  103. # set f2cMenu ・134
  104.  
  105. menu -n "$f2cMenu" -p f2cMenuProc { 
  106.     /K<UtranslateFToC
  107.     (-
  108.     openProject
  109.     getProject
  110.     {menu -n switchToProject -p f2cSwitchToProject {}}
  111.     (-
  112.     /R<Urun
  113.     /M<Umake
  114.     (-
  115.     <SfToC&AddFilesノ
  116.     <SaddFile
  117.     <S<EremoveFilesノ
  118.     <SremoveFile
  119.     (-
  120.     {menu -n otherFiles -p f2cOtherFilesProc {}}
  121.     {menu -n projectFiles -p f2cProjectFilesProc {}}
  122.     (-
  123. }
  124. enableMenuItem "$f2cMenu" run off
  125. enableMenuItem "$f2cMenu" make off
  126. enableMenuItem "$f2cMenu" AddFile off
  127. enableMenuItem "$f2cMenu" RemoveFile off
  128. enableMenuItem "$f2cMenu" otherFiles off
  129. enableMenuItem "$f2cMenu" projectFiles off
  130. enableMenuItem "$f2cMenu" fToC&AddFilesノ off
  131. enableMenuItem "$f2cMenu" removeFilesノ off
  132.  
  133. # Build the project switch list
  134. addMenuItem switchToProject "removeFromListノ"
  135. enableMenuItem switchToProject removeFromList off
  136. addMenuItem switchToProject (-
  137. if {[info exists f2cProjects]} {
  138.     foreach item $f2cProjects {
  139.         addMenuItem -m switchToProject [file tail $item]
  140.     }
  141.     enableMenuItem switchToProject removeFromList on
  142. }
  143.                 
  144. # Tell alpha that f2cMenu is a new mode menu
  145. append allModeMenus { f2cMenu }
  146. set modeMenus(Fort) { f2cMenu }
  147. # or insert permanently
  148. #    insertMenu "$f2cMenu"
  149.  
  150.  
  151. #-----------------------------------------------------------------------
  152. # f2cMenu
  153. #-----------------------------------------------------------------------
  154. proc f2cMenu {} {} 
  155.  
  156. #-----------------------------------------------------------------------
  157. # f2cMenuProc
  158. #-----------------------------------------------------------------------
  159. proc f2cMenuProc {menu item} {
  160.     if {$item == "openProject"} {
  161.         f2cOpenOrGet open
  162.     } elseif {$item == "getProject"} {
  163.         f2cOpenOrGet get
  164.     } elseif {$item == "translateFToC"} {
  165.         f2cTranslateFToC
  166.     } elseif {$item == "run"} {
  167.         f2cRun
  168.     } elseif {$item == "make"} {
  169.         f2cMake
  170.     } elseif {$item == "addFile"} {
  171.         f2cAddFile
  172.     } elseif {$item == "fToC&AddFiles"} {
  173.         f2c&AddFiles
  174.     } elseif {$item == "removeFile"} {
  175.         f2cRemoveFile
  176.     } elseif {$item == "removeFiles"} {
  177.         f2cRemoveFiles
  178.     } else {
  179.         f2cEdit $item
  180.     }
  181. }
  182.  
  183. #-----------------------------------------------------------------------
  184. # f2cSwitchToProject
  185. #-----------------------------------------------------------------------
  186. proc f2cSwitchToProject {menu item} {
  187.     global CODEWarrior CWCLASS 
  188.     global f2cProjects project projectdir projecttail oldProject
  189.  
  190.     if {$item == "removeFromList"} {
  191.         set name [listpick -l -L blah -p "Pick project to remove from switch list:" $f2cProjects]
  192.         if {[info exists f2cProjects]} {
  193.             foreach item $name {
  194.                 deleteMenuItem -m switchToProject [file tail $item]
  195.                 if {[set i [lsearch -exact $f2cProjects "$item"]] >= 0} {
  196.                     set f2cProjects [lreplace $f2cProjects $i $i]
  197.                 }
  198.             }
  199.             addDef f2cProjects $f2cProjects
  200.         }
  201.         enableMenuItem switchToProject $projecttail
  202.  
  203.     } else {
  204.         if {[set i [lsearch $f2cProjects "*$item"]] >=0 } {
  205.             set newproject [lindex $f2cProjects $i]
  206.         } else {
  207.             alertnote "Project $item not found"
  208.             return
  209.         }
  210.         f2cClean
  211.         set project $newproject
  212.         set projectdir [file dirname $project]
  213.         set projecttail [file tail $project]
  214.         f2cCheckCw
  215.          AEBuild -t 500000 -r $CODEWarrior $CWCLASS ClsP]
  216.         AEBuild $CODEWarrior aevt odoc "----" [makeAlis $project]
  217.         f2cUpdate
  218.     }
  219. }
  220.  
  221. #-----------------------------------------------------------------------
  222. # f2cClean
  223. #-----------------------------------------------------------------------
  224. proc f2cClean {} {
  225.     global f2cMenu otherFiles project oldProject projectFiles
  226.  
  227.     # remember old project
  228.     if {[info exists project]} {
  229.         set blah [file tail $project]
  230.         catch {deleteMenuItem -m $f2cMenu "$blah"}
  231.         set oldProject $project
  232.     }
  233.  
  234.     # remove project files
  235.      if {[info exists projectFiles]} {
  236.         foreach item $projectFiles {catch {deleteMenuItem -m projectFiles $item}}
  237.         set projectFiles {}
  238.     }
  239.  
  240.     # remove other files
  241.      if {[info exists otherFiles]} {
  242.         foreach item $otherFiles {catch {deleteMenuItem -m otherFiles $item}}
  243.         set otherFiles {}
  244.     }
  245. }
  246.  
  247. #-----------------------------------------------------------------------
  248. # f2cUpdate
  249. #-----------------------------------------------------------------------
  250. proc f2cUpdate {} {
  251.     global f2cJobs f2cMenu otherFiles projectdir projecttail 
  252.     global CODEWarrior CWCLASS oldProject projectFiles
  253.  
  254.     # Enable old and disable new project in switch list
  255.     if {[info exists oldProject]} {
  256.         enableMenuItem switchToProject [file tail $oldProject] on
  257.      }
  258.     enableMenuItem switchToProject $projecttail off
  259.     
  260.     # Clean the list of files to be f2c'ed
  261.     set f2cJobs {}
  262.  
  263.     # Show current project in menu
  264.     addMenuItem -m $f2cMenu "($projecttail"
  265.     
  266.     # If a *.f file in the project directory has a corresponding *.c file
  267.     # in the CodeWarrior project append it to the list projectFiles else to the
  268.     # list otherFiles
  269.     foreach f [glob $projectdir:*.f] {
  270.         regsub {¥.f$} $f {.c} cfile
  271.         set res [AEBuild -t 500000 -r $CODEWarrior $CWCLASS FInP "----" [makeAlis $cfile]]
  272.         regexp {:¥[(.*)¥]} $res dummy err
  273.         if {! $err} {
  274.             lappend projectFiles [file tail $f]
  275.         } else {
  276.             lappend otherFiles [file tail $f]
  277.         }
  278.     }
  279.     
  280.     # Update menu of project files
  281.     if {[info exists projectFiles]} {
  282.         foreach item $projectFiles { addMenuItem -m projectFiles $item }
  283.     }
  284.     
  285.     # Update menu of other files
  286.     if {[info exists otherFiles]} {
  287.         foreach item $otherFiles { addMenuItem -m otherFiles $item }
  288.     }
  289.     
  290.     # Update f2cMenu
  291.      enableMenuItem "$f2cMenu" run on
  292.      enableMenuItem "$f2cMenu" make on
  293.     enableMenuItem "$f2cMenu" addFile on
  294.     enableMenuItem "$f2cMenu" fToC&AddFilesノ on
  295.     enableMenuItem "$f2cMenu" removeFile on
  296.     enableMenuItem "$f2cMenu" removeFilesノ on
  297.     enableMenuItem "$f2cMenu" otherFiles on
  298.     enableMenuItem "$f2cMenu" projectFiles on
  299. }
  300.     
  301. #-----------------------------------------------------------------------
  302. # f2cOpenOrGet: get open CodeWarrior project or
  303. #                    close project and open with standard file dialog
  304. #-----------------------------------------------------------------------
  305. proc f2cOpenOrGet {job} {
  306.     global CODEWarrior CWCLASS f2cProjects project projectdir projecttail 
  307.  
  308.     f2cClean
  309.  
  310.     # Open or get CodeWarrior project
  311.     f2cCheckCw
  312.     if {$job == "open"} {
  313.         # Close current project, select new project, codewarrior open
  314.          AEBuild -t 500000 -r $CODEWarrior $CWCLASS ClsP
  315.         set project [getfile "Select CodeWarrior Project"]
  316.         AEBuild $CODEWarrior aevt odoc "----" [makeAlis $project]
  317.     } else {
  318.         # Get name of open cw project
  319.         set project [AEBuild -t 500000 -r $CODEWarrior $CWCLASS GetP]
  320.         regexp {ヌ(.*)ネ} $project dummy spec
  321.         set project [specToPathName $spec]
  322.         if {$project == ""} {
  323.             set project [getfile "Select Code Warrior Project"]
  324.             AEBuild $CODEWarrior aevt odoc "----" [makeAlis $project]
  325.         }
  326.     }
  327.     set projectdir [file dirname $project]
  328.     set projecttail [file tail $project]
  329.     
  330.     # update f2cprojects
  331.     if {[info exists f2cProjects]} {
  332.         # check wether project in f2cprojects
  333.         if {[lsearch -exact $f2cProjects $project] == -1} {
  334.             # no, update
  335.             lappend f2cProjects $project
  336.             addDef f2cProjects $f2cProjects
  337.             addMenuItem -m switchToProject $projecttail 
  338.         }
  339.     } else {
  340.         # f2cProjects still undefined, define
  341.         lappend f2cProjects $project
  342.         addDef f2cProjects $f2cProjects
  343.         addMenuItem -m switchToProject $projecttail
  344.     }
  345.      
  346.     f2cUpdate
  347. }
  348.  
  349. #-----------------------------------------------------------------------
  350. # f2cEdit: edit or bring to front
  351. #-----------------------------------------------------------------------
  352. proc f2cEdit {item} {
  353.     global projectdir
  354.  
  355.     # bring to front if file is open, otherwise edit
  356.     if {[catch {bringToFront $item}]} {edit $projectdir:$item}
  357. }
  358.  
  359. proc f2cOtherFilesProc {menu item} {f2cEdit $item}
  360. proc f2cProjectFilesProc {menu item} {f2cEdit $item}
  361.  
  362. #-----------------------------------------------------------------------
  363. # f2cCheck: check wether MAC F2C is running, launch it if not
  364. #-----------------------------------------------------------------------
  365. proc f2cCheck {} {
  366.     global MACF2C
  367.     set MACF2C [checkRunning "Mac F2C"  F2Ci f2cpath]
  368. }
  369.  
  370. #-----------------------------------------------------------------------
  371. # f2cTranslateFToC: translate file in the frontmost window from f to c
  372. #-----------------------------------------------------------------------
  373. proc f2cTranslateFToC {} { 
  374.  
  375.     global ALPHA MACF2C res f2cMenu
  376.     # get name of frontmost window
  377.     set fname [lindex [winNames -f] 0]
  378.     # return if not *.f
  379.     if {[regexp {.f$} $fname] == 0} return
  380.     # save if window dirty
  381.     getWinInfo win
  382.     if {$win(dirty)} {save}
  383.     # compile 
  384.     f2cCheck
  385.     switchTo $MACF2C
  386.     f2cOneFile $fname
  387.     switchTo $ALPHA
  388. }
  389.  
  390. #-----------------------------------------------------------------------
  391. # f2cOneFile: translate a single file from f to c
  392. #-----------------------------------------------------------------------
  393. proc f2cOneFile {fname} {
  394.     global f2cJobs f2cMenu MACF2C ALPHA
  395.     
  396.     set res [AEBuild -t 500000 -r  $MACF2C F2Ci F2C1 "----" [makeAlis $fname]]
  397.     regexp {:¥[(.*)¥]} $res dummy err
  398.     if {! $err} {
  399.         # f2c sucessful, remove file from f2cJobs
  400.         set i [lsearch -exact $f2cJobs $fname]
  401.         if {$i >= 0} {set f2cJobs [lreplace $f2cJobs $i $i]}
  402.         return 0
  403.     } else {
  404.         switchTo $ALPHA
  405.         # set item to fname without path
  406.          regexp {[^:]*$} $fname item
  407.         f2cEdit $item
  408.         return 1
  409.     }
  410. }
  411.  
  412. #-----------------------------------------------------------------------
  413. # f2cAddFile: add file in the front window to project
  414. #-----------------------------------------------------------------------
  415. proc f2cAddFile {} { 
  416.     global CODEWarrior CWCLASS projectdir f2cMenu projectFiles otherFiles
  417.  
  418.     # get name of current window
  419.     set fname [lindex [winNames -f] 0]
  420.  
  421.     # return if not *.f 
  422.     if {[regexp {.f$} $fname] == 0} return
  423.     
  424.     # return if not in projectdir
  425.     set blah [file tail $fname]
  426.     set fname $projectdir:$blah
  427.     if {[file exists $fname] != 1} return
  428.      
  429.     # return if *.c file not in projectdir
  430.     regsub {¥.f$} $fname {.c} cname
  431.     if {[file exists $cname] != 1} return
  432.  
  433.     # ok, add to project and update menu
  434.     f2cAddOneFile $cname
  435. }
  436.  
  437. #-----------------------------------------------------------------------
  438. # f2cAddFiles
  439. #-----------------------------------------------------------------------
  440. proc f2c&AddFiles {} {
  441.     global otherFiles projectFiles projectdir MACF2C ALPHA
  442.     set name [listpick -l -L blah -p "Pick files to add to project:" $otherFiles]
  443.     saveAll
  444.     foreach item $name {
  445.         regsub {¥.f$} $item {.c} citem
  446.         set cname $projectdir:$citem
  447.         # compile 
  448.         set fname $projectdir:$item
  449.         f2cCheck
  450.         switchTo $MACF2C
  451.          if {[f2cOneFile $fname]} return
  452.         switchTo $ALPHA
  453.         f2cAddOneFile $cname
  454.     }
  455. }
  456.  
  457.  
  458. #-----------------------------------------------------------------------
  459. # f2cAddOneFile
  460. #-----------------------------------------------------------------------
  461. # add .c file to project and update menu
  462. # the file is added to segment 1, without specification of Segm,
  463. # each time a file is added, a new segment is build
  464. proc f2cAddOneFile {cname} {
  465.     global projectFiles otherFiles CODEWarrior CWCLASS
  466.     set res [AEBuild -t 500000 -r  $CODEWarrior $CWCLASS AddF "----" [makeAlis $cname] Segm 1 ]
  467.     regexp {:¥[(.*)¥]} $res dummy err
  468.     if {! $err} {
  469.         regsub {¥.c$} $cname {.f} fname
  470.         set blah [file tail $fname]
  471.         addMenuItem -m projectFiles $blah
  472.         deleteMenuItem -m otherFiles $blah
  473.         lappend projectFiles $blah
  474.         if {[set i [lsearch -exact $otherFiles "$blah"]] >= 0} {
  475.                 set otherFiles [lreplace $otherFiles $i $i]
  476.         }
  477.     }
  478. }
  479.  
  480. #-----------------------------------------------------------------------
  481. # f2cRemoveOneFile
  482. #-----------------------------------------------------------------------
  483. proc f2cRemoveOneFile {cname} {
  484.     global projectFiles otherFiles CODEWarrior CWCLASS
  485.     set res [AEBuild -t 500000 -r  $CODEWarrior $CWCLASS RemF "----" [makeAlis $cname]]
  486.     regexp {:¥[(.*)¥]} $res dummy err
  487.     if {! $err} {
  488.         regsub {¥.c$} $cname {.f} fname
  489.         set blah [file tail $fname]
  490.         deleteMenuItem -m projectFiles $blah
  491.         addMenuItem -m otherFiles $blah
  492.         lappend otherFiles $blah
  493.         if {[set i [lsearch -exact $projectFiles "$blah"]] >= 0} {
  494.                 set projectFiles [lreplace $projectFiles $i $i]
  495.         }
  496.     }
  497. }
  498.  
  499.  
  500.  
  501. #-----------------------------------------------------------------------
  502. # f2cRemoveFile: remove file in the front window from project
  503. #-----------------------------------------------------------------------
  504. proc f2cRemoveFile {} {
  505.     global CODEWarrior CWCLASS projectdir f2cMenu projectFiles otherFiles
  506.  
  507.     # get name of current window
  508.     set fname [lindex [winNames -f] 0]
  509.  
  510.     # return if not *.f 
  511.     if {[regexp {.f$} $fname] == 0} return
  512.     
  513.     # return if not in projectdir 
  514.     set blah [file tail $fname]
  515.     set fname $projectdir:$blah
  516.     if {[file exists $fname] != 1} return
  517.      
  518.     # return if *.c file not in projectdir
  519.     regsub {¥.f$} $fname {.c} cname
  520.     if {[file exists $cname] != 1} return
  521.  
  522.     # ok, remove from project and update menu
  523.     f2cRemoveOneFile $cname
  524. }
  525.  
  526. #-----------------------------------------------------------------------
  527. # f2cRemoveFiles
  528. #-----------------------------------------------------------------------
  529. proc f2cRemoveFiles {} {
  530.     global projectFiles otherFiles projectdir
  531.     set name [listpick -l -L blah -p "Pick files to remove from project:" $projectFiles]
  532.     foreach item $name {
  533.         regsub {¥.f$} $item {.c} citem
  534.         set cname $projectdir:$citem
  535.         f2cRemoveOneFile $cname
  536.     }
  537. }
  538.  
  539.  
  540. #------------------------------------------------------------------------
  541. #    f2cRun: f2c translate (if necessary), followed by CodeWarrior run 
  542. #------------------------------------------------------------------------
  543. proc f2cRun {} { 
  544.     global ALPHA MACF2C f2cJobs
  545.  
  546.     saveAll
  547.     if {$f2cJobs != ""} {
  548.         # something to do for f2c
  549.         f2cCheck
  550.         switchTo $MACF2C
  551.          foreach fname $f2cJobs {
  552.              if {[f2cOneFile $fname]} return
  553.          }
  554.      }
  555.     cwrun
  556. }
  557. #------------------------------------------------------------------------
  558. #    f2cMake: f2c translate (if necessary), followed by CodeWarrior make
  559. #------------------------------------------------------------------------
  560. proc f2cMake {} { 
  561.     global ALPHA MACF2C f2cJobs
  562.  
  563.     saveAll
  564.     if {$f2cJobs != ""} {
  565.         # something to do for f2c
  566.         f2cCheck
  567.         switchTo $MACF2C
  568.          foreach fname $f2cJobs {
  569.              if {[f2cOneFile $fname]} return
  570.          }
  571.      }
  572.     cwmake
  573.     switchTo $ALPHA
  574. }
  575.  
  576.  
  577. #-----------------------------------------------------------------------
  578. # saveHook: modified by adding f2c support
  579. #            each time a .f file is saved, its name is added to f2cJobs
  580. #-----------------------------------------------------------------------
  581. proc saveHook name {
  582.     global backup backExtension backDir mode 
  583.  
  584. # f2c support added by kt
  585.     global f2cJobs
  586.     # get filename without path
  587.     regexp {[^:]*$} $name item
  588.     if {[regexp {.f$} $item]}  {    
  589.         # is *.f
  590.         if {[regexp $name $f2cJobs] == 0} {
  591.             # not contained in f2cJobs, append
  592.             lappend f2cJobs $name
  593.         }
  594.     }
  595. # end of added f2c support
  596.  
  597.     if ($backup) { 
  598.         if {![string length [set dir $backDir]]} {
  599.             set dir [file dirname $name]
  600.         }
  601.         if {![file exists $dir]} {
  602.             if {[askyesno "Create backup dir '$dir'?"] == "yes"} {
  603.                 mkdir $dir
  604.             }
  605.         }
  606.         catch {rm $dir:[file tail $name]$backExtension}
  607.         catch {cp $name $dir:[file tail $name]$backExtension}
  608.     }
  609. }
  610.  
  611. #-----------------------------------------------------------------------
  612. # f2cCheckCw: modified checkCw from codewarrior.tcl
  613. #-----------------------------------------------------------------------
  614. proc f2cCheckCw {} {
  615.     global CODEWarrior modifiedVars cwSig cwPath
  616.  
  617.     # last parameter is default 1 = launch -f, 0 = launch
  618.     set CODEWarrior [checkRunning "CodeWarrior IDE 1.3.1" $cwSig cwPath 0]
  619.     
  620.     set sig [getFileSig $cwPath]
  621.     if {$sig != $cwSig} {
  622.         lappend modifiedVars cwSig
  623.         set cwSig $sig
  624.     }
  625. }
  626.         
  627.